package org.iteam.xlz.manager.action.membershipcard;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.iteam.web.struts.action.AbstractModuleAction;
import org.iteam.web.struts.action.RestAction;
import org.iteam.xlz.core.entity.recharge.RechargeRecord;
import org.iteam.xlz.core.service.membershipcard.RecordService;

@SuppressWarnings("unchecked")
@Result(name="INDEX",type="freemarker",location="/WEB-INF/content/membershipcard/record/index.html")
public class RecordAction extends AbstractModuleAction<RechargeRecord> implements RestAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 4368701151313967499L;
	private final String PATH="/membershipcard/record";
	@Override
	public RechargeRecord getModel() {
		if(null==model){
			model=new RechargeRecord();
		}
		return model;
	}
	@Override
	@Action(PATH+"/index")
	public String index() throws Exception {
		return INDEX;
	}

	@Override
	@Action(PATH+"/query")
	public String query() {
		map.put("total",RecordService.getInstance().counts(model.getUid()));
		map.put("rows",RecordService.getInstance().query(model.getUid(),page,rows));
		return MAP;
	}

	@Override
	public String show() {
		return null;
	}

	@Override
	public String create() {
		return null;
	}

	@Override
	public String update() {
		return null;
	}

	@Override
	public String delete() {
		return null;
	}

	@Override
	public String destroy() {
		return null;
	}

	@Override
	public String edit() throws Exception {
		return null;
	}

	@Override
	public String editNew() throws Exception {
		return null;
	}
}
